﻿<UserControl x:Class="SSCCMembershipContent.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:dyn="clr-namespace:DynamicLoader;assembly=DynamicLoader"
             xmlns:local="clr-namespace:SSCCMembershipContent"
             xmlns:sec="clr-namespace:SecurityLib;assembly=SecurityLib"
    d:DesignHeight="300" d:DesignWidth="400">

    <UserControl.Resources>
        <local:NavigateCommand x:Key="Navigate"/>
        <Storyboard x:Name="ContentOpening">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="ContentBorder">
                <!--<EasingDoubleKeyFrame x:Name="Animation1" KeyTime="0" Value="0"/>-->
                <EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="ContentClosing">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="ContentBorder">
                <!--<EasingDoubleKeyFrame  KeyTime="0" Value="0"/>-->
                <EasingDoubleKeyFrame x:Name="Animation2" KeyTime="0:0:0.8" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot"  Margin="3,0,3,3">
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="7*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="200"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Image Source="/Shepperton_Club.jpg" Stretch="Uniform" Margin="0"/>
        
        <!--<TextBlock x:Name="TitleLabel" Grid.Column="1" FontSize="32"  Foreground="{StaticResource PurpleBrush}"/>-->
        <Rectangle Margin="-100,0,0,0" Grid.Row="1" Fill="White"></Rectangle>

        <Border Grid.Row="1" BorderThickness="8" CornerRadius="20,2,2,20" BorderBrush="{StaticResource PurpleBrush}">
            <Border.Background>
                <RadialGradientBrush GradientOrigin="-1,-1">
                    <GradientStop Color="#FF726F6F" Offset="1"/>
                    <GradientStop Color="White"/>
                </RadialGradientBrush>
            </Border.Background >
            <StackPanel >
                <TextBlock Height="20"/>
                <!--<HyperlinkButton Content="Keys" Height="23" FontSize="20" TargetName="ChildContentFrame" NavigateUri="/Keys" />
                <HyperlinkButton Content="Personal Details" Height="23" FontSize="20" TargetName="ChildContentFrame" NavigateUri="/PersonalDetails" />
                <HyperlinkButton Content="Rack Allocation" Height="23" FontSize="20" TargetName="ChildContentFrame" NavigateUri="/RackAllocation" />-->
                <Button Command="{StaticResource Navigate}" CommandParameter="U_UserHome.UserHomePage">Home</Button>
                <Button Command="{StaticResource Navigate}" CommandParameter="A_ManageUsers.MainPage" sec:Security.AuthenticatedRoles="EditAbilities+EditRoles+EditUsers">Manage Users</Button>
                <Button Command="{StaticResource Navigate}" CommandParameter="A_DirectDBAccess.MainPage" sec:Security.AuthenticatedRoles="DirectDBAccess">Direct Database Access</Button>
                <Button Command="{StaticResource Navigate}" CommandParameter="A_ReferenceCodes.MainPage" sec:Security.AuthenticatedRoles="EditRefCodes">Ref Codes</Button>
                <Button Command="{StaticResource Navigate}" CommandParameter="A_PrintBlankForm.MainPage" sec:Security.AuthenticatedRoles="PrintMembersForm">Print Members Form</Button>
                <Button Command="{StaticResource Navigate}" CommandParameter="ChangePasswordApp.View.PasswordChangeView">Change Password</Button>
                <Button Click="Logout">Logout</Button>
 
            </StackPanel>
        </Border>
        <Border Margin="-10,5,0,5" Canvas.ZIndex="-1000" x:Name="ContentBorder" Grid.Row="1" Grid.Column="1" RenderTransformOrigin="0.5,0.5" BorderThickness="8" CornerRadius="0,20,20,0" BorderBrush="{StaticResource PurpleBrush}">
            <Border.Background>
                <RadialGradientBrush GradientOrigin="-1,-1">
                    <GradientStop Color="#FF726F6F" Offset="1"/>
                    <GradientStop Color="White"/>
                </RadialGradientBrush>
            </Border.Background >
            <Border.RenderTransform>
                <CompositeTransform/>
            </Border.RenderTransform>
            <dyn:DynamicContentLoader x:Name="ContentLoader" Margin="5" Template="{StaticResource InstantChangeDynamicContentLoader}" />
        </Border>

    </Grid>
</UserControl>
